import java.util.Random;
import java.util.Scanner;

public class Job04 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int[][] CJ = new int[3][5];
        String[] KC = new String[]{"Java","JSP","CoreJava","MySQL","HTML5"};
        Random random = new Random();
        int scores = 0;
        int[] Totle = new int[CJ.length];
        for (int i = 0; i < CJ.length; i++) {
            for (int j = 0; j < CJ[i].length; j++) {
                CJ[i][j] = random.nextInt(101);
                Totle[i] += CJ[i][j];
            }
        }
        for (int i = 0; i < CJ.length; i++) {
            System.out.println("\n第" +(i+1)+ "名学生成绩");
            for (int k = 0; k < KC.length; k++) {
                System.out.print("" +KC[k]+ "\t\t\t");
            }
            System.out.println("\n");
            for (int j = 0; j < CJ[i].length; j++) {
                System.out.print("成绩:");
                System.out.print(CJ[i][j]+ "分\t\t");
            }
            System.out.println("\n");
            System.out.println("总成绩:" +Totle[i]+ "分");
        }
        System.out.println("请输入某每课程平均分:(1,Jvav 2,JSP 3,CoreJava 4,MySQL 5,HTML5)");
        int index = input.nextInt();
        for (int i = 0; i < CJ.length; i++) {
            scores += CJ[i][index -1];
        }
        System.out.println("平均分:" +scores/3);
    }
}
